import request from '@/utils/request';
export const workorder = {
    list: (params) =>request.get('/api/workorder/list', {params}),
    detail: (params) => request.get('/api/workorder/detail', {params}),
    history: (params) => request.get('/api/workorder/history', {params}),
    create: (data) => request.post('/api/workorder/create', data),
    assign: (data) => request.post('/api/workorder/assign', data),
    start: (data) => request.post('/api/workorder/start', data),
    complete: (data) => request.post('/api/workorder/complete', data),
    fail: (data) => request.post('/api/workorder/fail', data),
    upload: (data) => request({
        url: '/api/repair/upload',
        method: 'post',
        data,
        headers: { 'Content-Type': 'multipart/form-data' }
    }),
    update: (data) => request({
        url: '/api/repair/update',
        method: 'put',
        data
    })
};